package com.lwl.office.webeditor.parser;

import cn.hutool.core.bean.BeanUtil;
import com.lwl.office.webeditor.ParserContext;
import com.lwl.office.webeditor.style.RStyle;
import com.lwl.office.webeditor.style.Style;
import org.jsoup.nodes.Node;

public class EmNodeParser extends NodeParser{
    @Override
    public void parser(ParserContext context, Style style) {
        RStyle rStyle = style==null?new RStyle(): (RStyle) style;
        rStyle.setItalic(true);
        for (Node node : getNode().childNodesCopy()) {
            ParserSelector.select(node).parser(context, BeanUtil.toBean(rStyle,RStyle.class));
        }
    }
}
